﻿@model MvcAtletIS.Models.LiveModel
@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <title>AtletIS Live</title>
    <link href="@Url.Content("~/Content/css/Live.css")" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/modernizr-1.7.min.js")" type="text/javascript"></script>
    <script src="http://code.jquery.com/jquery-1.8.0.min.js" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.easing.js")" type="text/javascript"></script>
</head>
<body>
    
    <!-- COMPETITION -->
    <div class="competition">
        <img class="logo" src="@Url.Content("~/Content/logos/" + Model.ActiveCompetition.Organiser +".png")"/>
        <div class="float-right" style="margin: 5px 20px 60px 0;">@Html.Partial("_ChangeCulturePartial")</div>
        <div class="text">
            <div class="title">@Model.ActiveCompetition.Name</div>
            <div class="subtitle">
                @Model.ActiveCompetition.City 
                @Model.ActiveCompetition.DateFrom.Value.ToString("dd.MM.yyyy")
                @if (Model.ActiveCompetition.DateFrom.Value != Model.ActiveCompetition.DateTo.Value)
                {
                    @: - @Model.ActiveCompetition.DateTo.Value.ToString("dd.MM.yyyy")
                }
            </div>
            
        </div>
    </div>

    <div class="float-left">
        <!-- DISCIPLINE LIST -->
        <ul id="discipline-list">
            @foreach (var item in Model.DisciplineList)
            {
                if (item.ID == Model.ActiveDiscipline.ID)
                {
                    <li class="disc1" style="background: #ddd;">
                        <img src="@Url.Content("~/Content/icons/c0" + item.DisciplineCode + ".png")" alt="atletis" />
                        <a href="/Live?CompetitionId=@Model.ActiveCompetition.ID&DisciplineId=@item.ID&Code=@Model.Code">
                            @item.Name
                            <div class="desc">
                                @Model.ActiveCompetition.DateFrom.Value.AddDays(item.Day.Value - 1).ToString("dd.MM.yyyy") - @item.OfficialStartTime 
                            </div>
                        </a>
                    </li>
                }
                else
                {
                    <li class="disc1">
                        <img src="@Url.Content("~/Content/icons/c0" + item.DisciplineCode + ".png")" alt="atletis" />
                        <a href="/Live?CompetitionId=@Model.ActiveCompetition.ID&DisciplineId=@item.ID&Code=@Model.Code">
                            @item.Name
                            <div class="desc">
                                @Model.ActiveCompetition.DateFrom.Value.AddDays(item.Day.Value - 1).ToString("dd.MM.yyyy") - @item.OfficialStartTime 
                            </div>
                        </a>
                    </li>
                }

            }
        </ul>
    </div>

    <div class="float-left">
        <!-- FUNCTIONS -->
        <div id="functions">
        
            @if (Model.Code == "SL")
            {
                <a href="/Live?CompetitionId=@Model.ActiveCompetition.ID&DisciplineId=@Model.ActiveDiscipline.ID&Code=SL" style="background: #ddd;">@ViewRes.SharedStrings.StartList</a>
            }
            else
            {
                <a href="/Live?CompetitionId=@Model.ActiveCompetition.ID&DisciplineId=@Model.ActiveDiscipline.ID&Code=SL">@ViewRes.SharedStrings.StartList</a>
            }

            @if (Model.ActiveCompetition.DateFrom.Value.Date <= DateTime.Now.Date)
            {
                if (Model.Code == "RES")
                {
                <a href="/Live?CompetitionId=@Model.ActiveCompetition.ID&DisciplineId=@Model.ActiveDiscipline.ID&Code=RES" style="background: #ddd;">@ViewRes.SharedStrings.Results</a>
                }
                else
                {
                <a href="/Live?CompetitionId=@Model.ActiveCompetition.ID&DisciplineId=@Model.ActiveDiscipline.ID&Code=RES">@ViewRes.SharedStrings.Results</a>
                }

                if (Model.Code == "CHRES")
                {
                    <a href="/Live?CompetitionId=@Model.ActiveCompetition.ID&DisciplineId=@Model.ActiveDiscipline.ID&Code=CHRES" style="background: #ddd;">@ViewRes.SharedStrings.ChipResults</a>
                }
                else
                {
                    <a href="/Live?CompetitionId=@Model.ActiveCompetition.ID&DisciplineId=@Model.ActiveDiscipline.ID&Code=CHRES">@ViewRes.SharedStrings.ChipResults</a>
                }

                if (Model.ShowLiveChipData)
                {
                    if (Model.Code == "CHV")
                    {
                        <a href="/Live?CompetitionId=@Model.ActiveCompetition.ID&DisciplineId=@Model.ActiveDiscipline.ID&Code=CHV" style="background: #ddd;">@ViewRes.SharedStrings.ChipViewer</a>
                    }
                    else
                    {
                        <a href="/Live?CompetitionId=@Model.ActiveCompetition.ID&DisciplineId=@Model.ActiveDiscipline.ID&Code=CHV">@ViewRes.SharedStrings.ChipViewer</a>
                    }
                }
            }

        </div>

        <!-- CONTENT -->
        @if (Model.Code == "RES")
        {
            @Html.Partial("ResultsPartial", Model)
        }
        else if (Model.Code == "CHRES")
        {
            @Html.Partial("ChipResultsPartial", Model)
        }
        else if (Model.Code == "CHV")
        {
            @Html.Partial("ChipViewerPartial", Model)
        }
        else
        {
            @Html.Partial("StartListPartial", Model)
        }
    </div>

</body>
</html>
